﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.Zimer>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Model.name %> - נלך
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HeadContent" runat="server">
   <meta name="description" content="<%= Html.Encode(Model.description) %>" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="left">
        <div class="gallerycontainer">
            <% 
                var en = Model.Image.OrderBy(p => p.path, new nelech.Views.Shared.Code.ImagePathComparer()).GetEnumerator();
                for (var i = 0; i < 7; i++)
                {
                    if (!en.MoveNext())
                        break;

                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
            %>
            <a class="thumbnail" href="#thumb">
                <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" width="150px" /><br />
                <span>
                    <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                    <br />
                    <%=image.text%></span></a>
            <%=image.text%>
            <%
                }
            %>
        </div>
        <%Html.RenderAction("AdvertShow", "Advert", new { id = 7, region = Model.regeon });%>
    </div>
    <div id="main">
        <h2>
            <%= Model.name %></h2>
        <p class="print">
            <a href="javascript:window.print()">הדפס דף זה</a>
        </p>
        <p>
            <span class="bold">אזור:</span><%= Model.Regeon1.text %></p>
        <p>
            <%if (Model != null && Model.Size != null)
              {%>
            <span class="bold">סוג:</span>
            <%    foreach (var size in Model.Size)
                  {
                      Response.Write(size.text + ", ");
                  }
              }
            %></p>
           
        <div class="description" id="zimer">
            <p>
                <%= Model.description %>
            </p>
            <p>
                <span class="bold">טלפון להזמנות:</span><%= Model.phone %>
            </p>
            <p>
                <span class="bold">כתובת:</span><%= Model.address %>
            </p>
            <p>
                <span class="bold">קישור:</span><a href="<%= Model.link %>" target="_blank"><%= Model.name %></a>
            </p>
            <div style="position: relative; z-index: 5000; overflow: visible; height: 200px;">
                <% for (var i = 0; en.MoveNext() && i < 3; i++)
                   { 
                %>
                <div class="gallerycontainer">
                    <%
                       var image = en.Current;
                       var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
                    %>
                    <a class="thumbnail" href="#thumb">
                        <p>
                            <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" height="125px" /><br />
                            <%=image.text%></p>
                        <span>
                            <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                            <br />
                            <%=image.text%>
                        </span></a>
                </div>
                <%} %>
            </div>
        </div>
        <div id="map">
        </div>
        <p>
            המפה באדיבות WAZE - קהילת הנהגים של ישראל (ראה <a href="http://waze.co.il">waze.co.il</a>)</p>
        <% 
            var renderPlace = nelech.Views.Shared.Code.Utils.GetEmbeddedString("nelech.Views.Shared.RenderPlaceOnWazeFunction.txt");

            Response.Write(renderPlace);
        %>
        <%
            Response.Write(
                "<script>" +
                "function onInit()" +
                "{" +
                "RenderPlaceOnWaze(" + Model.lon + "," + Model.lat + ",'" + Model.name.Replace("'", "\\'") + "','http://nelech.co.il/Content/Images/wazelogoZimer1.png');" +
                "}" +
                "</script>"
                );
        %>
        <%
            var wazeBody = nelech.Views.Shared.Code.Utils.GetEmbeddedString("nelech.Views.Shared.WazeBody.txt");
            wazeBody = wazeBody.Replace("{0}", Model.lon.ToString());
            wazeBody = wazeBody.Replace("{1}", Model.lat.ToString());
            Response.Write(wazeBody);
        %>
        <!-- _DEBUG_INC_ -->
        <script type="text/javascript" src="http://www.waze.co.il/js/OpenLayers.js"> </script>
        <!-- _DEBUG_INC_ -->
        <script type="text/javascript" src="http://www.waze.co.il/js/jquery.js"></script>
        <!-- _DEBUG_INC_ -->
        <script type="text/javascript" src="http://www.waze.co.il/js/mapnik.js"></script>
        <!-- _DEBUG_INC_ -->
        <script type="text/javascript" src="http://www.waze.co.il/js/WazePanZoomBar.js"></script>
        <script type="text/javascript" src="http://www.waze.co.il/js/WazeEmbeddedMap.js"></script>
      
        <%if (Model.chackted != null)
          { %>
        <p>
            <span class="bold">נבדק לאחרונה בתאריך:</span>
            <%=nelech.Views.Shared.Code.Utils.GetHebrewJewishDateString(Model.chackted.Value, true)%>, <%: Model.chackted.Value.ToString("dd/MM/yyyy") %>
        </p>
        <%} %>
        <div class="fb-like" data-href="http://www.facebook.com/www.nelech.co.il" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
        <%
            Html.RenderPartial("ListFeedback", ViewData["ListFeedbacks"]);%>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="publishTop" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Right" runat="server">
    <p>
        <iframe src="http://www.israelweather.co.il/upload/weekly<%= Html.Encode(Model.Regeon1.weather) %>.html"
            width="200" height="125" dir="rtl" name='in_frame' frameborder='0' scrolling='No'>
        </iframe>
    </p>
    <%var array = (int[])ViewData["advertsArray"];
      var count = (int)ViewData["advertCount"];
      if (count > 0)
      {
          Html.RenderAction("AdvertShowThree", "Advert", new { id = 6, region = Model.regeon, noRandom = array[0] });
      }%>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="RightAdvert" runat="server">
    <%var count = (int)ViewData["advertCount"];
      var array = (int[])ViewData["advertsArray"];
      if (count > 0)
      {

          Html.RenderAction("AdvertShow", "Advert", new { id = 6, region = Model.regeon, random1 = array[0] });
      }%>
</asp:Content>
